:- use_module( library( clpfd ) ).

start :-
Nats = [Briton, Swede, Dane, Norwegian, German],
all_different([Briton, Swede, Dane, Norwegian, German]), 
Nats ins 1..5,
Drinks = [Tea, Coffee, Water, Beer, Milk],
all_different([Tea, Coffee, Water, Beer, Milk]),
Drinks ins 1..5,
Colour = [Red, White, Green, Yellow, Blue],
all_different([Red, White, Green, Yellow, Blue]),
Colour ins 1..5,
Pet = [Dog, Bird, Cat, Horse, Fish],
all_different([Dog, Bird, Cat, Horse, Fish]),
Pet ins 1..5,
Smoke = [Pallmall, Dunhill, Marlboro, Winfield, Rothmanns],
all_different([Pallmall, Dunhill, Marlboro, Winfield, Rothmanns]),
Smoke ins 1..5,
label(Nats),
Briton #= Red,
Swede #= Dog,
Dane #= Tea,
Green #= White - 1, 
Green #= Coffee, 
Pallmall #= Bird, 
Milk #= 3,
Yellow #= Dunhill,
Norwegian #= 1,
abs(Marlboro - Cat) #= 1,
abs(Horse - Dunhill) #= 1,
Winfield #= Beer,
abs(Norwegian - Blue) #= 1,
German #= Rothmanns,
abs(Marlboro - Water) #=1,
nl,
write([Briton, Swede, Dane, Norwegian, German]), nl, 
write([Dog, Bird, Cat, Horse, Fish]).